<template>
  <view class="pageTitle between-center">
    <u-grid :border="false" col="4">
      <u-grid-item
        v-for="(baseListItem, baseListIndex) in baseList"
        :key="baseListIndex"
        @click="() => handleClick(baseListItem,baseListItem.url, baseListItem.tabbar)"
      >
        <!-- <img :src="baseListItem.img_url alt="" /> -->
        <img :src="baseListItem.img_url" alt="" class="grid_img" />
        <text class="grid-text">{{ baseListItem.desc_text }}</text>
      </u-grid-item>
    </u-grid>
  </view>
</template>

<script>
export default {
  name: "pageTitle",
  props: {
    baseList: [],
  },
  data() {
    return {};
  },

  mounted() {
    console.log(baseList);
    
  },
  methods: {
    handleClick(baseListItem,url, tabbar) {
      console.log('测试',baseListItem,tabbar);
      if (tabbar) {
        uni.switchTab({
          url,
        });
      } else {
        uni.navigateTo({
          url,
        });
      }
    },
  },
};
</script>

<style scoped>
.grid-text {
  font-size: 28upx;
  color: #666;
  margin-top: 10upx;
}
.grid_img {
  width: 100upx;
  height: 100upx;
  border-radius: 50%;
  background-color: #f0f0f0;
}
.pageTitle {
  margin-top: 40upx;
}
</style>
